package com.xm.queue.task;

import lombok.extern.slf4j.Slf4j;

/**
 * 消费者/工人
 */
@Slf4j
public class Consumer {
    private Consumer() {}

    /**
     * 消费者工人数量
     */
    private static final int WORKER_NUM;

    static {
        WORKER_NUM = TaskUtil.CORE_POOL_SIZE;
        for (int i = 0; i < WORKER_NUM; i++) {
            TaskUtil.submit(i);
        }
    }

    public static void init() {
        log.info("消费者工人初始化完成");
    }

}
